package com.yohann.designPattern.decorator.consumer;

import com.yohann.designPattern.decorator.coffee.Drink;
import com.yohann.designPattern.decorator.coffee.LongBlackCoffee;
import com.yohann.designPattern.decorator.condiment.Chocolate;
import com.yohann.designPattern.decorator.condiment.Milk;

/**
 * <p>
 * 咖啡屋
 * </p>
 *
 * @author Yohann
 * @since 2021/2/7 15:26
 */
public class CoffeeBar {
    public static void main(String[] args) {
        //创建一个咖啡
        Drink longBlack = new LongBlackCoffee();
        //添加牛奶
        Milk milkLongBlack = new Milk(longBlack);
        //添加巧克力
        Chocolate chocolateMilkLongBlack = new Chocolate(milkLongBlack);

        //LongBlackCoffee && Milk 0.99 && Chocolate 1.29 = 10.2699995
        System.out.println(chocolateMilkLongBlack.getDescription() + " = " + chocolateMilkLongBlack.cost());
    }
}